<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template split_iterator</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../string_algo/reference.html#doxygen.find__iterator_8hpp" title="Header &lt;boost/algorithm/string/find_iterator.hpp&gt;">
<link rel="prev" href="classboost_1_1algorithm_1_1find__iterator.html" title="Class template find_iterator">
<link rel="next" href="find__iterator_8hpp_1ad38c3a3bab61a460b4af849b78c10f27.html" title="Function template make_find_iterator">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.html">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1algorithm_1_1find__iterator.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../string_algo/reference.html#doxygen.find__iterator_8hpp"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="find__iterator_8hpp_1ad38c3a3bab61a460b4af849b78c10f27.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.classboost_1_1algorithm_1_1split__iterator"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template split_iterator</span></h2>
<p>boost::algorithm::split_iterator — <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html" title="Class template split_iterator">split_iterator</a></p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../string_algo/reference.html#doxygen.find__iterator_8hpp" title="Header &lt;boost/algorithm/string/find_iterator.hpp&gt;">boost/algorithm/string/find_iterator.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> IteratorT<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html" title="Class template split_iterator">split_iterator</a> <span class="special">:</span> <span class="keyword">public</span> iterator_facade&lt; split_iterator&lt; IteratorT &gt;, const iterator_range&lt; IteratorT &gt;, forward_traversal_tag &gt;
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>

  <span class="comment">// <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html#id-1_3_3_9_10_2_1_2_7-bb">public member functions</a></span>
  <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html#doxygen.classboost_1_1algorithm_1_1split__iterator_1ab19f9d8a1aef6e398692103f1d5cba5c"><span class="identifier">split_iterator</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html#doxygen.classboost_1_1algorithm_1_1split__iterator_1a3c3b192536dbaad6b289f40da1bfc499"><span class="identifier">split_iterator</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html" title="Class template split_iterator">split_iterator</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
   <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html#doxygen.classboost_1_1algorithm_1_1split__iterator_1ad78f29ade98badc7eaa18f62e74d843c"><span class="identifier">BOOST_DEFAULTED_FUNCTION</span></a><span class="special">(</span><a class="link" href="classboost_1_1algorithm_1_1split__iterator.html" title="Class template split_iterator">split_iterator</a> <span class="special">&amp;</span> <span class="special">=</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">split_iterator</span> <span class="special">&amp;</span><span class="identifier">Other</span><span class="special">)</span><span class="special">,</span> 
                            <span class="special">{</span> <span class="keyword">if</span><span class="special">(</span><span class="keyword">this</span><span class="special">==</span><span class="special">&amp;</span><span class="identifier">Other</span><span class="special">)</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">base_type</span><span class="special">::</span><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="identifier">Other</span><span class="special">)</span><span class="special">;</span><span class="identifier">m_Match</span><span class="special">=</span><span class="identifier">Other</span><span class="special">.</span><span class="identifier">m_Match</span><span class="special">;</span><span class="identifier">m_Next</span><span class="special">=</span><span class="identifier">Other</span><span class="special">.</span><span class="identifier">m_Next</span><span class="special">;</span><span class="identifier">m_End</span><span class="special">=</span><span class="identifier">Other</span><span class="special">.</span><span class="identifier">m_End</span><span class="special">;</span><span class="identifier">m_bEof</span><span class="special">=</span><span class="identifier">Other</span><span class="special">.</span><span class="identifier">m_bEof</span><span class="special">;</span><span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span><span class="special">}</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">IteratorT</span> <span class="identifier">FinderT</span> <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html#doxygen.classboost_1_1algorithm_1_1split__iterator_1a8021db5cfaf313136305311699df9e27"><span class="identifier">m_Match</span></a><span class="special">(</span><span class="identifier">Begin</span><span class="special">,</span> <span class="identifier">Begin</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">IteratorT</span> <span class="identifier">FinderT</span> <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html#doxygen.classboost_1_1algorithm_1_1split__iterator_1a210315bff37133c42df2598f9782266f"><span class="identifier">m_Next</span></a><span class="special">(</span><span class="identifier">Begin</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">IteratorT</span> <span class="identifier">FinderT</span> <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html#doxygen.classboost_1_1algorithm_1_1split__iterator_1a0cf335b6460acd1fe91b48b86012eb6e"><span class="identifier">m_End</span></a><span class="special">(</span><span class="identifier">End</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">IteratorT</span> <span class="identifier">FinderT</span> <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html#doxygen.classboost_1_1algorithm_1_1split__iterator_1ad027ec52c22f1f032d1c1b581a89b298"><span class="identifier">m_bEof</span></a><span class="special">(</span><span class="keyword">false</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> FinderT<span class="special">,</span> <span class="keyword">typename</span> RangeT<span class="special">&gt;</span> 
    <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html#doxygen.classboost_1_1algorithm_1_1split__iterator_1a3438074fc157dbb5ccd318145152506a"><span class="identifier">split_iterator</span></a><span class="special">(</span><span class="identifier">RangeT</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">FinderT</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html#doxygen.classboost_1_1algorithm_1_1split__iterator_1afb4aa6cb927fe0c168aa6f5c3d0a42e0"><span class="identifier">eof</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html#id-1_3_3_9_10_2_1_2_8-bb">private member functions</a></span>
  <span class="keyword">const</span> <span class="identifier">match_type</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html#doxygen.classboost_1_1algorithm_1_1split__iterator_1a27ba8589f04d67613f28cdf84e215dc1"><span class="identifier">dereference</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html#doxygen.classboost_1_1algorithm_1_1split__iterator_1a688a23c92a4f5928ef146bdbc13760ae"><span class="identifier">increment</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html#doxygen.classboost_1_1algorithm_1_1split__iterator_1aa11a54d81dc065093380302f908c836c"><span class="identifier">equal</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html" title="Class template split_iterator">split_iterator</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

  <span class="comment">// public data members</span>
  <span class="identifier">IteratorT</span> <span class="identifier">End</span><span class="special">;</span>
  <span class="identifier">IteratorT</span> <span class="identifier">FinderT</span> <span class="identifier">Finder</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.3.9.11.5.4"></a><h2>Description</h2>
<p>Split iterator encapsulates a Finder and allows for incremental searching in a string. Unlike the find iterator, split iterator iterates through gaps between matches.</p>
<p>Find iterator is a readable forward traversal iterator.</p>
<p>Dereferencing the iterator yields an iterator_range delimiting the current match. </p>
<div class="refsect2">
<a name="id-1.3.3.9.11.5.4.5"></a><h3>
<a name="id-1_3_3_9_10_2_1_2_7-bb"></a><code class="computeroutput">split_iterator</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="doxygen.classboost_1_1algorithm_1_1split__iterator_1ab19f9d8a1aef6e398692103f1d5cba5c"></a><span class="identifier">split_iterator</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Default constructor. <p>Construct null iterator. All null iterators are equal.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Postconditions:</span></p></td>
<td><p><a class="link" href="classboost_1_1algorithm_1_1split__iterator.html#doxygen.classboost_1_1algorithm_1_1split__iterator_1afb4aa6cb927fe0c168aa6f5c3d0a42e0">eof()</a>==true </p></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.classboost_1_1algorithm_1_1split__iterator_1a3c3b192536dbaad6b289f40da1bfc499"></a><span class="identifier">split_iterator</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html" title="Class template split_iterator">split_iterator</a> <span class="special">&amp;</span> Other<span class="special">)</span><span class="special">;</span></pre>Copy constructor. <p>Construct a copy of the <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html" title="Class template split_iterator">split_iterator</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"> <a name="doxygen.classboost_1_1algorithm_1_1split__iterator_1ad78f29ade98badc7eaa18f62e74d843c"></a><span class="identifier">BOOST_DEFAULTED_FUNCTION</span><span class="special">(</span><a class="link" href="classboost_1_1algorithm_1_1split__iterator.html" title="Class template split_iterator">split_iterator</a> <span class="special">&amp;</span> operator <span class="special">=</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">split_iterator</span> <span class="special">&amp;</span><span class="identifier">Other</span><span class="special">)</span><span class="special">,</span> 
                          <span class="special">{</span> <span class="keyword">if</span><span class="special">(</span><span class="keyword">this</span><span class="special">==</span><span class="special">&amp;</span><span class="identifier">Other</span><span class="special">)</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">base_type</span><span class="special">::</span><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="identifier">Other</span><span class="special">)</span><span class="special">;</span><span class="identifier">m_Match</span><span class="special">=</span><span class="identifier">Other</span><span class="special">.</span><span class="identifier">m_Match</span><span class="special">;</span><span class="identifier">m_Next</span><span class="special">=</span><span class="identifier">Other</span><span class="special">.</span><span class="identifier">m_Next</span><span class="special">;</span><span class="identifier">m_End</span><span class="special">=</span><span class="identifier">Other</span><span class="special">.</span><span class="identifier">m_End</span><span class="special">;</span><span class="identifier">m_bEof</span><span class="special">=</span><span class="identifier">Other</span><span class="special">.</span><span class="identifier">m_bEof</span><span class="special">;</span><span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span><span class="special">}</span><span class="special">)</span><span class="special">;</span></pre>Assignment operator. <p>Assigns a copy of the <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html" title="Class template split_iterator">split_iterator</a> Constructor</p>
<p>Construct new <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html" title="Class template split_iterator">split_iterator</a> for a given finder and a range. </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="identifier">IteratorT</span> <span class="identifier">FinderT</span> <a name="doxygen.classboost_1_1algorithm_1_1split__iterator_1a8021db5cfaf313136305311699df9e27"></a><span class="identifier">m_Match</span><span class="special">(</span><span class="identifier">Begin</span><span class="special">,</span> <span class="identifier">Begin</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">IteratorT</span> <span class="identifier">FinderT</span> <a name="doxygen.classboost_1_1algorithm_1_1split__iterator_1a210315bff37133c42df2598f9782266f"></a><span class="identifier">m_Next</span><span class="special">(</span><span class="identifier">Begin</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">IteratorT</span> <span class="identifier">FinderT</span> <a name="doxygen.classboost_1_1algorithm_1_1split__iterator_1a0cf335b6460acd1fe91b48b86012eb6e"></a><span class="identifier">m_End</span><span class="special">(</span><span class="identifier">End</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">IteratorT</span> <span class="identifier">FinderT</span> <a name="doxygen.classboost_1_1algorithm_1_1split__iterator_1ad027ec52c22f1f032d1c1b581a89b298"></a><span class="identifier">m_bEof</span><span class="special">(</span><span class="keyword">false</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> FinderT<span class="special">,</span> <span class="keyword">typename</span> RangeT<span class="special">&gt;</span> 
  <a name="doxygen.classboost_1_1algorithm_1_1split__iterator_1a3438074fc157dbb5ccd318145152506a"></a><span class="identifier">split_iterator</span><span class="special">(</span><span class="identifier">RangeT</span> <span class="special">&amp;</span> Col<span class="special">,</span> <span class="identifier">FinderT</span> Finder<span class="special">)</span><span class="special">;</span></pre>Constructor. <p>Construct new <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html" title="Class template split_iterator">split_iterator</a> for a given finder and a collection. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.classboost_1_1algorithm_1_1split__iterator_1afb4aa6cb927fe0c168aa6f5c3d0a42e0"></a><span class="identifier">eof</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Eof check. <p>Check the eof condition. Eof condition means that there is nothing more to be searched i.e. <a class="link" href="classboost_1_1algorithm_1_1find__iterator.html" title="Class template find_iterator">find_iterator</a> is after the last match. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.3.9.11.5.4.6"></a><h3>
<a name="id-1_3_3_9_10_2_1_2_8-bb"></a><code class="computeroutput">split_iterator</code> private member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><span class="keyword">const</span> <span class="identifier">match_type</span> <span class="special">&amp;</span> <a name="doxygen.classboost_1_1algorithm_1_1split__iterator_1a27ba8589f04d67613f28cdf84e215dc1"></a><span class="identifier">dereference</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.classboost_1_1algorithm_1_1split__iterator_1a688a23c92a4f5928ef146bdbc13760ae"></a><span class="identifier">increment</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.classboost_1_1algorithm_1_1split__iterator_1aa11a54d81dc065093380302f908c836c"></a><span class="identifier">equal</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1algorithm_1_1split__iterator.html" title="Class template split_iterator">split_iterator</a> <span class="special">&amp;</span> Other<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2002-2004 Pavol Droba<p>Use, modification and distribution is subject to the Boost
                Software License, Version 1.0. (See accompanying file
                <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
            </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1algorithm_1_1find__iterator.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../string_algo/reference.html#doxygen.find__iterator_8hpp"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="find__iterator_8hpp_1ad38c3a3bab61a460b4af849b78c10f27.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
